package com.wiscamp.ninechapters.threeparties.qiniu;

import com.qiniu.util.Auth;

class UploaderFactory {
    private UploaderFactory() {
    }

    public static FileUploader instance;

    public static FileUploader createUploader(String accessKey, String secretKeySpec, String bucketHostName, String bucketName) {
        if (instance == null) {
            var auth = Auth.create(accessKey, secretKeySpec);
            instance = new QiniuFileUploader(bucketHostName, bucketName, auth);
        }
        return instance;
    }
}
